home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / ActiveScript.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  10.7 KB  |  296 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsLocStrings.inc"-->
  3. <!--#include file="include/wmsServerHash.inc"-->
  4. <!--#include file="include/wmsPlugins.inc"-->
  5. <!--#include file="include/wmsHeader.inc"-->
  6. <!--#include file="include/wmsPageBanner.inc"-->
  7. <!--#include file="include/wmsError.inc"-->
  8. <!--#include file="plugin_loading.inc"-->
  9. <%
  10. '+-------------------------------------------------------------------------
  11. '
  12. '  Microsoft Windows Media
  13. '  Copyright (C) Microsoft Corporation. All rights reserved.
  14. '
  15. '  File:       ActiveScript.asp
  16. '
  17. '  Contents:
  18. '
  19. '--------------------------------------------------------------------------
  20.  
  21. BeginErrorHandling
  22. ConnectToPlugin
  23. ConnectToPluginAdmin
  24.  
  25. Dim bError
  26. Dim strFileName
  27. Dim dwErrorLine
  28. Dim dwErrorPos
  29. Dim strErrorText
  30. Dim dwTabIndex
  31.  
  32. dwTabIndex = 0
  33. bError = FALSE
  34.  
  35. HandlePluginLoadingChanges()
  36.  
  37. Dim strOp
  38. strOp = trim( posting( "submit" ) )
  39. if( 0 < Len( strOp ) ) then
  40.  
  41.     on error resume next
  42.  
  43. '---------------------------------------------------------------
  44. '   enable debugging set, if "enableDebugging" is defined in request form
  45. '---------------------------------------------------------------
  46.     if ( 0 = StrComp( "on", trim( posting("enableDebugging") ), vbTextCompare ) ) then
  47.         if( not g_objPluginAdmin.EnableDebugging ) then
  48.             g_objPluginAdmin.EnableDebugging = TRUE
  49.         end if
  50.     else
  51.         if( g_objPluginAdmin.EnableDebugging ) then
  52.             g_objPluginAdmin.EnableDebugging = FALSE
  53.         end if
  54.     end if
  55.  
  56.     if( ErrorDetected( "enableDebugging" ) ) then
  57.         bError = TRUE
  58.     end if
  59.     
  60. '---------------------------------------------------------------
  61. '   fileName set, if "fileName" is defined in the request form
  62. '---------------------------------------------------------------
  63.  
  64.     Dim strNewFileName
  65.     strNewFileName = CStr( SafeUnescape( trim( posting( "fileName" ) ) ) )
  66.  
  67.     if ( 0 >= Len( strNewFileName ) ) then
  68.         if( 0 < Len( g_objPluginAdmin.fileName ) ) then
  69.             g_objPluginAdmin.fileName = ""
  70.         end if
  71.     else
  72.         on error resume next
  73.         if( 0 <> StrComp( strNewFileName, g_objPluginAdmin.fileName, vbTextCompare ) ) then
  74.             if( MAX_PATH >= Len( strNewFileName ) ) then
  75.                 g_objPluginAdmin.fileName = strNewFileName
  76.             end if
  77.         end if
  78.     end if
  79.     
  80.     if( ErrorDetected( "fileName" ) ) then
  81.         Session( "PageReloadedToDisplayError" ) = 1
  82.         bError = TRUE
  83.     else
  84.         szExtraArgs = "&pendingOp=" & GetPostOrQsVal("pendingOp")
  85.         if( "" <> g_strPubPointName ) then
  86.             Response.Redirect "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex") & szExtraArgs
  87.         else
  88.             Response.Redirect "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex") & szExtraArgs
  89.         end if
  90.     end if
  91. end if
  92.  
  93. if not bError then
  94.     strFileName = g_objPluginAdmin.FileName
  95.     dwErrorLine = g_objPluginAdmin.ErrorLineNumber
  96.     dwErrorPos = g_objPluginAdmin.ErrorCharacterPosition
  97.     strErrorText = g_objPluginAdmin.ErrorText
  98. end if
  99.  
  100. WriteHTMLHeader( g_strDecodedServerName ) 
  101. %>
  102. <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
  103. <% WritePluginJSUtils %>
  104. </head>
  105. <body bgcolor="#FFFFFF" class="pluginBody" onLoad="JavaScript:AcquireInitialFilename();" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
  106. <% DrawPluginBanner %>
  107. <table width="<%= Server.HTMLEncode( STDTABLEWIDTH ) %>" cols=2 border="0">
  108. <tr>
  109.     <td valign=top>
  110.  
  111.         <% WriteStdPluginForm %>
  112.  
  113.         <div class="normal">
  114.  
  115.         <p> 
  116.         </div>
  117.         
  118.         <table cellspacing="0" border="0" class="propgroupbox" width="100%">
  119.         <caption align="left" class="pluginGroupHeader"><% RenderWithErrorCheck Server.HTMLEncode( L_FILENAMEOFSCRIPTCOLON_TEXT ) & "<br>", "fileName" %></caption>
  120.         <tr><td>
  121.         <input 
  122.             type="text" 
  123.             id="fileName" 
  124.             name="fileName" 
  125.             size="50%" 
  126.             maxlength="<%= Server.HTMLEncode( MAX_PATH ) %>" 
  127.             tabindex="1" value="<%= RemoveSpecifiedChars( strFileName, REGEXP_DANGEROUS_CHARS ) %>">
  128.         </td></tr></table>
  129.         <br>
  130.         <table border=1 cellspacing="0" cellpadding="0" width="100%">
  131.         <caption align="left" class="pluginGroupHeader"><%= Server.HTMLEncode( L_DEBUGGINGINFO_TEXT ) %></caption>
  132.         <tr>
  133.             <td>
  134.             <table cellspacing="0" cellpadding="0" border="0" width="100%" class="propgroupbox">
  135.                 <tr>
  136.                     <td width="10" ><img src="img\spacer_.gif" height="1px" width="10px"></td>
  137.                     <td width="100%">
  138.                         <input type="checkbox" id="enableDebugging" name="enableDebugging" tabindex=2 <%
  139.                             if g_objPluginAdmin.EnableDebugging then
  140.                                 Response.Write( "checked" )
  141.                             end if
  142.                         %> > 
  143.                         <label class="handcursor" for="enableDebugging"><% RenderWithErrorCheck Server.HTMLEncode( L_ENABLESCRIPTDEBUGGING_TEXT ) & "<br>", "enableDebugging" %></label>
  144.                     </td>
  145.                 </tr>
  146.             </table>
  147.             </td>
  148.             </tr>
  149.         </table>
  150.         <br>
  151.         <table border=1 cellspacing="0" cellpadding="0" width="100%" class="propgroupbox">
  152.         <caption align="left" class="pluginGroupHeader"><%= Server.HTMLEncode( L_LASTSCRERRINFO_TEXT ) %></caption>
  153.         <tr>
  154.             <td><br>
  155.             <table cellspacing="0" cellpadding="0" cols="3" border="0" width="100%">
  156.             <tr>
  157.                 <td width="10" ><img src="img\spacer_.gif" height="1px" width="10px"></td>
  158.                 <td>
  159.                     <div class="defaultcursor">
  160.                         <%= SpacesToNonbreak( L_LINENUMBERCOLON_TEXT ) %> 
  161.                     </div>
  162.                 </td>
  163.                 <td width=20% align="right">
  164.                     <table cellspacing="0" cellpadding="0" border=1 bgcolor="<% if 0 <> dwErrorLine then %>white<% else %>lightgrey<% end if %>">
  165.                     <tr>
  166.                         <td>
  167.                             <% if 0 <> dwErrorLine then %> <%= Server.HTMLEncode( dwErrorLine ) %> <% else %> <%= Server.HTMLEncode( L_NA_TEXT ) %> <% end if %>
  168.                         </td>
  169.                     </tr>
  170.                     </table>
  171.                 </td>
  172.                 <td align="right">
  173.                     <img src="img\spacer_.gif" height="1px" width="10px">
  174.                 </td>
  175.             </tr>
  176.             <tr>
  177.                 <td width="10" ><img src="img\spacer_.gif" height="1px" width="10px"></td>
  178.                 <td>
  179.                     <div class="defaultcursor">
  180.                         <%= SpacesToNonbreak( Server.HTMLEncode( L_CHARACTERCOLUMNCOLON_TEXT ) ) %> 
  181.                     </div>
  182.                 </td>
  183.                 <td width=20% align="right">
  184.                     <table cellspacing="0" cellpadding="0" border=1 bgcolor="<% if 0 <> dwErrorPos then %>white<% else %>lightgrey<% end if %>">
  185.                     <tr>
  186.                         <td>
  187.                             <% if 0 <> dwErrorPos then %> <%= Server.HTMLEncode( dwErrorPos ) %> <% else %> <%= Server.HTMLEncode( L_NA_TEXT ) %> <% end if %>
  188.                         </td>
  189.                     </tr>
  190.                     </table>
  191.                 </td>
  192.                 <td align="right">
  193.                     <img src="img\spacer_.gif" height="1px" width="10px">
  194.                 </td>
  195.             </tr>
  196.             <tr>
  197.                 <td width="10" ><img src="img\spacer_.gif" height="1px" width="10px"></td>
  198.                 <td>
  199.                     <div class="defaultcursor">
  200.                         <%= SpacesToNonbreak( Server.HTMLEncode( L_MOSTRECENTERRORCOLON_TEXT ) ) %> 
  201.                     </div>
  202.                 </td>
  203.                 <td width="20%" align="right">
  204.                     <table cellspacing="0" cellpadding="0" border=1 bgcolor="<% if 0 < Len( strErrorText ) then %>white<% else %>lightgrey<% end if %>">
  205.                     <tr>
  206.                         <td>
  207.                             <% if 0 < Len( strErrorText ) then %><%= Server.HTMLEncode( strErrorText ) %><% else %> <%= Server.HTMLEncode( L_NA_TEXT ) %> <% end if %>
  208.                         </td>
  209.                     </tr>
  210.                     </table>
  211.                 </td>
  212.                 <td align="right">
  213.                     <img src="img\spacer_.gif" height="1px" width="10px">
  214.                 </td>
  215.             </tr>
  216.             <tr>
  217.                 <td colspan=3>
  218.                      
  219.                 </td>
  220.             </tr>
  221.             </table>
  222.             </td>
  223.         </tr>
  224.         </table>
  225.     </td>
  226. </tr>
  227. <tr>
  228.     <td>
  229. <% dwTabIndex = 2 %>
  230. <% RenderPluginLoadingOptions() %>
  231.     </td>
  232. </tr>
  233. <tr>
  234.     <td valign="bottom">
  235.         <br>
  236.         <input type="submit" align="baseline" name="ok" <% if 0 <> ( WMS_PLUGIN_ENABLED and g_objPlugin.status ) then %>onclick="JavaScript:ResetWarning();"<% end if%> value="<%= Server.HTMLEncode( L_OKAYBUTTON_TEXT ) %>" tabIndex=<%= dwTabIndex + 1 %> > 
  237.         <input type="button" align="baseline" name="cancel" onclick="JavaScript:Cancel()" value="<%= Server.HTMLEncode( L_CANCELBUTTONSPACED_TEXT ) %>" tabIndex=<%= dwTabIndex + 2 %>> 
  238.         <input type="button" align="baseline" name="help" onclick="JavaScript:DoPluginHelp( '<%= H_ACTIVESCRIPTHELPTOPIC %>' )" value="<%= Server.HTMLEncode( L_HELPBUTTONSPACED_TEXT ) %>" id="help" tabindex=<%= dwTabIndex + 3 %>>
  239.     </td>
  240. </tr>
  241. </table>
  242. </font>
  243. </form>
  244. <%
  245. AlertUserWithPopupErrorDialog
  246. OnErrorGoBack
  247. DrawStdFooter
  248. %>
  249. </body>
  250. <script language="JavaScript">
  251. <!--
  252. /*@cc_on @*/
  253.  
  254. var g_strOriginalFilename;
  255.  
  256. ///////////////////////////////////////////////////////////////////////
  257. function AcquireInitialFilename()
  258. {
  259.     <% jsTRY %>
  260.         var objInput;
  261.         objInput = document.forms.pluginForm.fileName;
  262.         g_strOriginalFilename = new String( objInput.value );
  263.     <% jsCATCH %>
  264. }
  265.  
  266. ///////////////////////////////////////////////////////////////////////
  267. function ResetWarning()
  268. {
  269.     <% jsTRY %>
  270.         var strNewFileName = new String( document.forms.pluginForm.fileName.value );
  271.         if( strNewFileName.toLowerCase() != g_strOriginalFilename.toLowerCase() )
  272.         {
  273.             window.alert( "<%= RemoveDangerousCharacters( L_RESETPLUGINWARN_TEXT ) %>" );
  274.         }
  275.         else
  276.         {
  277.             var objCheckbox = document.forms.pluginForm.enableDebugging;
  278.             var bChecked = objCheckbox.checked;
  279.             if( bChecked != <% if g_objPluginAdmin.EnableDebugging then %>true<% else %>false<% end if %> )
  280.             {
  281.                 window.alert( "<%= RemoveDangerousCharacters( L_RESETPLUGINWARN_TEXT ) %>" );
  282.             }
  283.         }
  284.     <% jsCATCH %>
  285. }
  286. -->
  287. </script>
  288. </html>
  289. <% 
  290. LatchCurrentPage "plugins/ActiveScript.asp", qs
  291. EndErrorHandling "ActiveScript.asp" 
  292.  
  293. on error resume next
  294. PluginsASPCleanup
  295. %>
  296.